import request from '@/utils/request'

// 获取品牌数据
export const reqTradeMarkList = (page, limit) => request({
  url: `/admin/product/baseTrademark/${page}/${limit}`,
  method: 'get'
})

// 添加品牌 和 修改品牌
export const addOrUpdateTradeMark = (data) => {
  if (data.id) {
    // 修改品牌
    return request({
      url: '/admin/product/baseTrademark/update',
      method: 'put',
      data
    })
  } else {
    // 添加品牌
    return request({
      url: '/admin/product/baseTrademark/save',
      method: 'post',
      data
    })
  }
}

// 删除品牌
export const deleteTradeMark = (id) => request({
  url: `/admin/product/baseTrademark/remove/${id}`,
  method: 'delete'
})